//获取openid 和手机号
export const getPhoneApi = async (code) => {
	const {
		data: res
	} = await uni.$http.get('/api/auth/getLoginInfo', {
		code,
		key: 'jkyz'
	})
	return res
}

//用户token
export const getTokenApi = async (openId, phone) => {
	const {
		data: res
		// } = await uni.$http.get(`/api/auth/wxLogin?openId=${openId}&phone=${phone}`)
	} = await uni.$http.post('/api/auth/wxLogin', {
		miniKey: 'jkyz',
		openId,
		phone,
		register: false,
		type: "1"
	})
	return res
}

//查询用户所有答题记录
export const getAnswerListApi = async (pageNum) => {
	const {
		data: res
	} = await uni.$http.post('/api/subject/result/queryListByPage', {
		pageNum,
		"pageSize": 15,
	})
	return res
}

//用户用药记录
export const getMedicationsApi = async (pageNum) => {
	const {
		data: res
	} = await uni.$http.post('/api/vip/applet/queryListByPage', {
		pageNum,
		"pageSize": 15,
	})
	return res
}

//获取个人信息
export const getUserInfoApi = async () => {
	const {
		data: res
	} = await uni.$http.post('/api/vip/own')
	return res
}

//  根据字典类型查询字典信息
export const findDictsApi = async (data) => {
	const {
		data: res
	} = await uni.$http.post(`/api/systemDictData/findDictData`,data)
	return res
}